//
//  BusinessCell.m
//  小团购
//
//  Created by 樊荣海 on 15/2/9.
//  Copyright (c) 2015年 樊荣海. All rights reserved.
//

#import "BusinessCell.h"
@interface BusinessCell()
@property (weak, nonatomic) IBOutlet UILabel *upLabel;

@property (weak, nonatomic) IBOutlet UILabel *downLabel;

@property (weak, nonatomic) IBOutlet UIImageView *bg;

@end

@implementation BusinessCell


- (void)awakeFromNib {
    self.backgroundColor = [UIColor clearColor];
    self.backgroundView = nil;
    
//    NSLog(@"cell frame: %@", NSStringFromCGRect(self.frame));
//    NSLog(@"contentView frame: %@", NSStringFromCGRect(self.contentView.frame));
//    NSLog(@"_upLabel frame: %@", NSStringFromCGRect(_upLabel.frame));
//    NSLog(@"_downLabel frame: %@", NSStringFromCGRect(_downLabel.frame));
//    NSLog(@"_bg frame: %@", NSStringFromCGRect(_bg.frame));
    
    //不知道为什么 长度会变化
    CGRect rect = _upLabel.frame;
    rect.size.width = 370;
    _upLabel.frame = rect;
    
    CGRect rect2 = _downLabel.frame;
    rect2.size.width = 370;
    _downLabel.frame = rect2;
    
    CGRect rect3 = _bg.frame;
    rect3 = CGRectMake(-5, 0, 440, 60);
    _bg.frame = rect3;
    
}

- (void)setUpTitle:(NSString *)upTitle {

    _upTitle = upTitle;
    _upLabel.text = _upTitle;
}


- (void)setDownTitle:(NSString *)downTitle {
    _downTitle = downTitle;
    _downLabel.text = _downTitle;

}

- (void)setIndexPath:(NSIndexPath *)indexPath {

    _indexPath = indexPath;

    _bg.hidden = indexPath.row==0;

}


@end
